using _3GrpcUse.Services;
using ProtoBuf.Grpc.Server;

//仓库地址
//https://github.com/protobuf-net/protobuf-net/tree/main
//完整文档
//https://protobuf-net.github.io/protobuf-net.Grpc/

//代码先行
//https://protobuf-net.github.io/protobuf-net/build_tools
//契约先行
//https://protobuf-net.github.io/protobuf-net/contract_first

//库根据接口生成proto文件 
//https://protobuf-net.github.io/protobuf-net.Grpc/createProtoFile

var builder = WebApplication.CreateBuilder(args);
//依赖于Grpc.AspNetCore
builder.Services.AddGrpc(o => { });
builder.Services.AddCodeFirstGrpc(); //使用代码先行
var app = builder.Build();
app.MapGrpcService<GreeterService>();
app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");
app.Run();
